-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial selectorified API #2567
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand that you are re-creating from scratch
Shouldn't we rather build on top of https://github.com/o1-labs/proof-systems/blob/master/o1vm/src/mips/interpreter.rs ?
I would have expected a new function in interpreter similar to https://github.com/o1-labs/proof-systems/blob/master/o1vm/src/mips/interpreter.rs#L987C8-L987C23
But something done differently here : https://github.com/o1-labs/proof-systems/blob/master/o1vm/src/mips/interpreter.rs#L1047
|
||
pub type ExamplePosition = column::ColumnAlias; | ||
|
||
pub type ExampleVariable = ark_bn254::Bn254; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand that variables are a way to index to positions in the plonk matrix.
Therfore, I would use something like unsigned integer, but not a crypto related object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I changed to unsigned integer in the latest version.
Regarding the from-scratch approach shown here, this is mostly a playground where I can test out ideas which I will then port back to the regular interpreter, I think, without the full complexity of the regular interpreter. It didn't start out as that, mind you!
But I think you and Danny are right.
As discussed in PM, I would simply use an "iter" on the instructions with the constraint environment, multiplying by a selector, adding constraints on them on the way. |
C.f Arrabiata |
Closing as I decided on another approach. |
I have here a skeleton API for a selectorified API. This begins to address #2543 and #2545 (Perhaps? Comments?) by switching from the API used in
o1vm/src/mips/interpreter.rs
to that detailed ino1vmsrc/mips/singlestep.rs
.The main changes are:
a -> State -> (b, State)
enum
fields with them. This allows the generator style to uniformly look likeInstructions -> State -> (Witness, State)
and for witness generation, without having to worry about different arities and register arguments. [Of course, the old instructions with their arguments can be relatively easily converted to this form -- to come].ExampleS
previously an implementor ofInterpreterEnv
(Env
inwitness.rs
and the like) which will almost surely grow as the number of instructions returns to parity.The point of these changes is to provide a basic test-bed for the selector changes to come.